home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / comm / fido / showfigfonts.lha / showfigfonts.rexx < prev   
OS/2 REXX Batch file  |  1995-08-20  |  2KB  |  59 lines

  1. /* !/bin/sh -
  2.  showfigfonts by Glenn Chappell <ggc@uiuc.edu>
  3.  figlet release 2.1.1 -- 25 Aug 1994
  4.  Based on showfigfonts by Greg Galperin <grg@ai.mit.edu>, Nov 1993.
  5.  
  6.  ShowFigFonts.rexx by Roger Clark -- 20 August 1995
  7.  
  8.  Prints a list of available figlet fonts, along with a sample of each
  9.  font.  If directory is given, lists fonts in that directory; otherwise
  10.  uses the default font directory.  If word is given, prints that word
  11.  in each font; otherwise prints the font name.
  12.  
  13.  Usage: showfigfonts [ -d directory ] [ word ] */
  14.  
  15. Options Results
  16.  
  17. Parse Arg Arguments
  18. WordToType = ""
  19. FontDir = "Figlet:Fonts"
  20. Call Pragma("W","N")
  21.  
  22. Usage="Usage: RX ShowFigFonts.rexx [ -d directory ] [ word ]"
  23.  
  24. If Upper(word(Arguments,1))="-D" then Do
  25.   FontDir = Word(Arguments,2)
  26.   If Words(Arguments) = 3 then WordToType = Word(Arguments,3)
  27.   If Words(Arguments) > 3 | Words(Arguments) <2 then Do
  28.     Say Usage
  29.     Exit 1
  30.   End
  31. End
  32. Else Do
  33.   WordToType = Word(Arguments,1)
  34.   If Words(Arguments) > 1 then Do
  35.     Say Usage
  36.     Exit 1
  37.   End
  38. End
  39.  
  40. Call Open(Out,"Ram:FigletTemp","W")
  41.   Call WriteLn(Out,WordToType)
  42. Call Close(Out)
  43. FontList=ShowDir("Figlet:Fonts","File")
  44. do Loop = 1 to Words(FontList)
  45.   If Upper(Right(Word(FontList,Loop),4)) ~= ".FLF" then Iterate
  46.   If WordToType = "" then Do
  47.     Call Open(Out,"Ram:FigletTemp","W")
  48.       Call WriteLn(Out,Word(FontList,Loop))
  49.     Call Close(Out)
  50.   End
  51.   Say Word(FontList,Loop)
  52.   Say
  53.   Address Command "Figlet:Figlet -d "FONTDIR" -f "Word(FontList,Loop)" <Ram:FigletTemp"
  54.   Say
  55.   Say
  56. End
  57. Address Command "Delete Ram:FigletTemp Quiet"
  58. Exit
  59.